<template>
  <AdForm v-bind="fromConfig" v-model="models"></AdForm>
</template>
<script lang="ts" setup>
import { reactive, ref } from 'vue';
import type { AdFormPorps, SelectOptions } from '@fe-hl/admin-design-vue';
interface Models {
  keyword: string;
  mercId: string;
  status: string;
  startime: string;
  endtTme: string;
}
const models = ref<Models>();
const fromConfig: AdFormPorps<Models> = reactive({
  span: 8,
  components: [
    {
      model: 'mercId',
      components: 'el-select-v2',
      options: () => {
        return new Promise<SelectOptions[]>((resolve) => {
          // 这里可以是异步操作（如 API 请求）
          let list = [];
          for (let index = 0; index < 100000; index++) {
            list.push({
              label: `商户号-${index + 1}`,
              value: index,
            });
          }
          resolve(list);
        });
      },
      props: {
        label: '商户号',
      },
    },
  ],
  submit: (models) => {
    console.log(models);
  },
  resetForm: () => {
    console.log('resetForm');
  },
});
</script>
